package com.yihusitian.zsxq.sg.generator;

import com.google.common.collect.Sets;
import com.yihusitian.zsxq.sg.config.BaseClassInfo;
import com.yihusitian.zsxq.sg.util.CommonInfoHolder;
import lombok.Getter;

import java.util.Set;

/**
 * @Description TODO
 * @Author LeeHo
 * @Date 2020/8/26 20:02
 */
public class ServiceImplSourceGenerator implements SourceGenerator {

    @Getter
    private Set<String> importSet = Sets.newHashSet();

    @Override
    public Set<String> getImportSet() {
        return Sets.newHashSet(
                String.format(IMPORT_TEMPLATE, generateConfigHolder.getDoInfo().getPackagePath(), CommonInfoHolder.getCurrentBusinessName() + generateConfigHolder.getDoInfo().getClassNameSuffix()),
                String.format(IMPORT_TEMPLATE, generateConfigHolder.getServiceInfo().getPackagePath(), CommonInfoHolder.getCurrentBusinessName() + generateConfigHolder.getServiceInfo().getClassNameSuffix()),
                String.format(IMPORT_TEMPLATE, generateConfigHolder.getMapperInfo().getPackagePath(), CommonInfoHolder.getCurrentBusinessName() + generateConfigHolder.getMapperInfo().getClassNameSuffix())
        );
    }
    @Override
    public BaseClassInfo getBaseClassInfo() {
        return generateConfigHolder.getServiceImplInfo();
    }
}